<?php
namespace app\admin\controller;

class Adminrolelist extends Come{
    public function adminrolelist(){
        // $reslist=db('admin_user')->select();
        // $this->assign('reslist',$reslist);
        // return $this->fetch('admin-table');

        $reslist	=	db('administrator_role')->paginate(5);
        //	把分页数据赋值给模板变量list
        $this->assign('reslist',$reslist);
        //	渲染模板输出
        return	$this->fetch('adminrolelist');
    }
    public function delete(){
        $delId=input('param.delId','','htmlspecialchars');
        $res=db('administrator_role')->where('id',$delId)->delete();
        if($res>0){
            $this->success('删除成功!','admin/adminrolelist/adminrolelist');
        }else{
            $this->error('删除失败');
        }
    }
}